package com.lai.qq.db.common.service.impl;


import com.lai.qq.db.common.api.entity.AppSoft;
import com.lai.qq.db.common.api.service.AppSoftDbService;
import com.lai.qq.db.common.mapper.AppSoftMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.entity.Example;
import java.util.List;


@Service
@Slf4j
public class AppSoftDbServiceImpl implements AppSoftDbService {

    @Autowired
    private AppSoftMapper appSoftMapper;

    @Override
    public List<AppSoft> selectByExample(AppSoft apSoft) {
        Example example = new Example(AppSoft.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("terminalType", apSoft.getTerminalType());
        criteria.andEqualTo("softType", apSoft.getSoftType());
        criteria.andGreaterThan("appVersion", apSoft.getAppVersion());
        criteria.andEqualTo("isValid", 1);
        List<AppSoft> appSoftList = appSoftMapper.selectByExample(example);
        return appSoftList;
    }
}
